/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package ejercicio2;
import java.io.*;
import java.util.Scanner;


/**
 *
 * @author User
 */
public class ejercicio6 {
    static int[] InvertirArray(int[] ar) {
        int[] revestArray = new int[ar.length];
        int contador = 0;
        for(int i=ar.length-1;i>=0;i--) 
        {
            revestArray[contador] = ar[i];
            contador++;
        }
        return revestArray;
    }
    static void MostrarArray(int[] ar) {
        for(int i=0;i<ar.length;i++) 
        {
            System.out.println(ar[i]);
        }
    }
    public static void main(String[] args)  {
        Scanner reader = new Scanner(System.in);
        int numero;
        System.out.print("¿Cuantos valores vas a introducir?");
        numero = reader.nextInt();
        int[] array = new int[numero];
        for(int i=0;i<numero;i++) 
        {
            System.out.print("Introduceme un valor: ");
            array[i] = reader.nextInt();
        }
        /************************************
         * Invertimos el array
         ************************************/
        array = InvertirArray(array);
        /************************************
         * Mostramos array
         ************************************/
        MostrarArray(array);
    }
}
